﻿using System;
using System.Collections.Generic;
using System.Text;
using Windows.UI;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

namespace Reference.Apps.Converters
{
    public class LangToSolidColorBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            string lang = value as String;
            SolidColorBrush brush = null;
            switch (lang)
            {
                case "cpp":
                    brush = new SolidColorBrush(Color.FromArgb(255, 0, 117, 4));
                    break;
                case "cs":
                    brush = new SolidColorBrush(Color.FromArgb(255, 214, 93, 19));
                    break;
                case "java":
                    brush = new SolidColorBrush(Color.FromArgb(255, 68, 88, 168));
                    break;
                default:
                    brush = new SolidColorBrush(Colors.Gray);
                    break;
            }
            return brush;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
